﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OurFAS.Data;

namespace OurFAS.MySystem
{
    public partial class FrmChangePwd : Form
    {
        #region 构造函数
        public FrmChangePwd()
        {
            InitializeComponent();
        }
        #endregion

        private void btnConfirm_Click(object sender, EventArgs e)
        {
            if (tbNewPwd.Text != tbConfirmNewPwd.Text)
            {
                MessageBox.Show("对不起，您两次输入的新密码不一致！");
                return;
            }
            string str = "";
            if (DataHelper.ChangePwd(FrmMain.CurrentUser.UserCode, tbOldPwd.Text, tbNewPwd.Text, ref str))
            {
                MessageBox.Show(str);
                this.Close();
            }
            else
            {
                MessageBox.Show(str);
            }
            
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        #region 私有函数

        #endregion
    }
}
